<template>
	<view class="stockpile-wrap">
		<view class="order-list" v-for="item in stockpileList" :key="item.id">
			<view class="goods-order">
				<view class="order-content">
					<t-mini-card
						:type="item.activity_type"
						:title="item.goods_title"
						:describe="item.goods_sku_text"
						:number="item.goods_num"
						:price="item.goods_price"
						@click="$Router.push({ path: '/pages/goods/detail/index', query: { id: item.goods_id } })"
						:image="item.goods_image"
					>
						<template #cardBottom>
							<view class="order-price-wrap x-f ">
								<text class="order-price">{{ item.goods_price || 0 }}</text>
								<button class="cu-btn status-btn" v-if="item.status_name">{{ item.status_name }}</button>
							</view>
						</template>
					</t-mini-card>
				</view>
			</view>
		</view>
		<!-- 空白页 -->
		<t-empty v-if="!stockpileList.length" :emptyData="emptyData"></t-empty>
	</view>
</template>

<script>
export default {
	components: {},
	data() {
		return {
			stockpileList: [],
			emptyData: {
				img: this.$IMG_URL + '/empty/empty_goods.png',
				tip: '暂无更多商品信息~'
			}
		};
	},
	computed: {},
	onLoad() {
		this.getStockpileList();
	},
	methods: {
		// 获取更多商品信息
		getStockpileList() {
			let that = this;
			that.$api('store.storeExpressDetail', {
				id: that.$Route.query.id,
				store_id: uni.getStorageSync('storeId')
			}).then(res => {
				if (res.code === 1) {
					that.stockpileList = res.data.items;
				}
			});
		}
	}
};
</script>

<style lang="scss">
// 订单列表
.order-list {
	background: #fff;
	margin: 20rpx 0;
	padding: 0 20rpx;
}
.goods-order {
	padding: 20rpx;
	margin-bottom: 20rpx;
	.order-price-wrap {
		width: 480rpx;
		.status-btn {
			background: none;
			height: 32rpx;
			border: 1rpx solid #ff6361;
			border-radius: 15rpx;
			font-size: 20rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #ff6361;
			padding: 0 10rpx;
			margin-left: 20rpx;
			background: rgba(#ff6361, 0.16);
		}
		.order-price {
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 600;
			color: rgba(51, 51, 51, 1);
			&::before {
				content: '￥';
				font-size: 22rpx;
			}
		}
	}
}
</style>
